package org.flashbrighton.as3bots.views
{
	import flash.display.Graphics;
	import flash.display.LineScaleMode;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.filters.GlowFilter;
	
	import org.flashbrighton.as3bots.controllers.ArenaController;

	public class ArenaView extends Sprite
	{		
		private static const SCALE_FACTOR:Number = 1.0; //normalised percentage
		public var shape : Sprite = new Sprite();
		
		public function ArenaView()
		{
			addChild(shape);
		}
		
		private static var START_WIDTH:Number = ArenaController.START_ARENA_WIDTH*GameView.SCALE_FACTOR;
		
		private function drawArena(size:Number):void
		{
			//return;
			shape.graphics.clear();
			var margin : Number = 19;
			var offset : Number = (START_WIDTH-size)/2;
			shape.graphics.lineStyle( 1, 0x30d030 );
			shape.graphics.beginFill( 0x308030 );
			shape.graphics.drawRoundRect( offset , offset, size,size, 20,20 );
			shape.graphics.endFill();
			shape.graphics.beginFill( 0x202020, 1 );
			shape.graphics.drawRoundRect( margin+offset , margin+offset, size - 2*margin, size- 2*margin,10,10 );
			shape.graphics.endFill();
		}
		
		public function set arenaWidth(value:Number):void{
			value *= GameView.SCALE_FACTOR;
			drawArena(value);
		}
		
		private function setScale():void
		{
			scaleX = SCALE_FACTOR;
			scaleY = SCALE_FACTOR;
		}
		
		
	}
}